package model

//AGV主类型类别
type RobotCategoryType uint8

const (
	CategoryTypeStocker          RobotCategoryType = 0 //堆垛车（熊猫车）
	CategoryTypeBalanced         RobotCategoryType = 1 //平衡重
	CategoryTypeFronted          RobotCategoryType = 2 //前移车
	CategoryTypeThreeWay         RobotCategoryType = 3 //三项叉
	CategoryTypeKIVA             RobotCategoryType = 4 //KIVA
	CategoryTypeTemporaryStorage RobotCategoryType = 5 //暂存车
	CategoryTypePallet           RobotCategoryType = 6 //托盘车
	CategoryTypeSideFork         RobotCategoryType = 7 //侧叉车
	CategoryTypeOmnibearing      RobotCategoryType = 8 //全向车
	CategoryTypeClamp            RobotCategoryType = 9 //抱夹车
)

//小车类型
type RobotType struct {
	CategoryId          int               `json:"category_id" bson:"category_id" binding:"required"`                       //小车子类型编号
	CategoryType        RobotCategoryType `json:"category_type" bson:"category_type"`                                      //主类型类别
	CategoryTypeValue   int               `json:"-" bson:"-"`                                                              //主类型类别
	CategoryName        string            `json:"category_name" bson:"category_name" binding:"required"`                   //小车子类型名称
	Length              int               `json:"length" bson:"length" binding:"required"`                                 //长度/mm
	LengthToFront       int               `json:"length_to_front" bson:"length_to_front" binding:"required"`               //旋转中心与车头的距离/mm
	Width               int               `json:"width" bson:"width" binding:"required"`                                   //宽度/mm
	SafeDis             int               `json:"safe_dis" bson:"safe_dis" binding:"required"`                             //车头安全距离/mm
	BackSafeDis         int               `json:"back_safe_dis" bson:"back_safe_dis"`                                      //车尾安全距离/mm
	RotateSafeDis       int               `json:"rotate_safe_dis" bson:"rotate_safe_dis"`                                  //旋转安全距离/mm
	SideSafeDis         int               `json:"side_safe_dis" bson:"side_safe_dis"`                                      //叉车侧向安全距离/mm
	MaxVel              int64             `json:"max_vel" bson:"max_vel" binding:"required"`                               //最大直线速度mm/s
	MaxAng              int64             `json:"max_ang" bson:"max_ang" binding:"required"`                               //最大弧线速度°/s
	RotateTime          int64             `json:"rotate_time" bson:"rotate_time" binding:"required"`                       //旋转耗时/ms
	StopTime            int               `json:"stop_time" bson:"stop_time" binding:"required"`                           //停车耗时/ms
	ChargePercent       int               `json:"charge_percent" bson:"charge_percent" binding:"required"`                 //充电阀值%
	ChargeToTaskPercent int               `json:"charge_to_task_percent" bson:"charge_to_task_percent" binding:"required"` //强制结束充电阔值%(任务充电阈值)
	LocalPathNodeNum    int               `json:"local_path_node_num" bson:"local_path_node_num" binding:"required"`       //默认局部路径最大缓存数，3-5个
	LocalPathDis        int64             `json:"local_path_dis" bson:"local_path_dis" binding:"required"`                 //局部路径最大长度10-20m
	WalkSafeHeight      int32             `json:"walk_safe_height" bson:"walk_safe_height" binding:"required"`             //货叉行走安全高度
	GoodsWidth          int               `json:"goods_width" bson:"goods_width" binding:"required"`                       //带货宽度/mm
	Goodslength         int               `json:"goods_length" bson:"goods_length" binding:"required"`                     //带货长度/mm

	LengthToBack          float64 `json:"-" bson:"length_to_back"`           //尾部长度/mm
	GoodsLengthToBack     float64 `json:"-" bson:"goods_length_to_back"`     //带货尾部长度/mm
	GoodsRotateRadius     float64 `json:"-" bson:"goods_rotate_radius"`      //带货前端旋转半径/mm
	GoodsRotateBackRadius float64 `json:"-" bson:"goods_rotate_back_radius"` //带货后端旋转半径/mm
	RotateRadius          float64 `json:"-" bson:"rotate_radius" `           //原地旋转最小半径/mm
	RotateBackRadius      float64 `json:"-" bson:"rotate_back_radius"`       //原地旋转时叉车后端占用距离/mm

	//ChargeType int `json:"charge_type" bson:"charge_type"` //该类型的叉车适用的充电桩类别
	// XyTolerance         int    `json:"xy_tolerance" bson:"xy_tolerance" binding:"required"`                     //可接受位置偏移 mm
	// YawTolerance        int    `json:"yaw_tolerance" bson:"yaw_tolerance" binding:"required"`                   //可接受偏移角度 °
	//ChargeFinishPercent int    `json:"charge_finish_percent" bson:"charge_finish_percent" binding:"required"`   //充电完成阈值%
	//LowPowerPercent     int    `json:"low_power_percent" bson:"low_power_percent" binding:"required"`           //强制充电阔值%
}

func (RobotType) TableName() string {
	return "t_data_robot_types"
}
